<?php
class ORMFile extends ORMBase {
  public function __construct() {
    parent::__construct('File');
  }

  public function __toEpObject($myManager, $epObject, $object) {
    $epObject->name = isset($object->name) ? $object->name : '';
    $epObject->size = isset($object->size) ? $object->size : 0;
    $epObject->width = isset($object->width) ? $object->width : 0;
    $epObject->height = isset($object->height) ? $object->height : 0;
    $epObject->thumbnail = isset($object->thumbnail) ? $object->thumbnail : '';
    $epObject->path = isset($object->path) ? $object->path : '';
    return $epObject;
  }

  public function __toObject($myManager, $epObject, $object) {
    $object->id = $epObject->oid;
    $object->name = $epObject->name;
    $object->size = $epObject->size;
    $object->width = $epObject->width;
    $object->height = $epObject->height;
    $object->thumbnail = $epObject->thumbnail;
    $object->path = $epObject->path;
    return $object;
  }
}
?>
